﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DA;
using BaseLib.Security;
using BL.Membership;

namespace BL
{
    public class UsersRepository : OrderDeskEntityRepository<User>
    {
        public override User Create(User entity, bool saveChanges = true)
        {
            if (entity.UserGuid == default(Guid))
                entity.UserGuid = Guid.NewGuid();

            if (entity.Password == null)
                entity.Password = "12345678";

            entity.LoginAttempts = 0;
            entity.ClientId = this.UserData.ClientId;

            return base.Create(entity, saveChanges);
        }
    }
}
